package com.seele.tigerwallet.ui.adapter;

import android.text.TextUtils;
import android.widget.TextView;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;
import com.seele.tigerwallet.R;
import com.seele.tigerwallet.model.TokenInfoModel;
import com.seele.tigerwallet.model.UserInfo;
import com.seele.tigerwallet.ui.utils.SPUtils;
import com.seele.tigerwallet.ui.utils.TypefaceUtils;

public class ManageWalletAdapter extends BaseQuickAdapter<TokenInfoModel, BaseViewHolder> {


    public ManageWalletAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(BaseViewHolder helper, TokenInfoModel item) {


        if (!TextUtils.isEmpty(item.name)) {
            helper.setText(R.id.token_name_tv, item.name);
        } else {
            helper.setText(R.id.token_name_tv, mContext.getResources().getString(R.string.wallet_name));
        }

        if (!TextUtils.isEmpty(item.address)) {
            helper.setText(R.id.toke_address, item.address);
        }

//        helper.setText(R.id.token_total_tv, 4.2564+"");

        if (SPUtils.isCNY()) {
            helper.setText(R.id.token_pice_tv, mContext.getResources().getString(R.string.cny));
        }else {
            helper.setText(R.id.token_pice_tv, mContext.getResources().getString(R.string.usdt));
        }

//        helper.setText(R.id.token_total_tv, SPUtils.getTotal(item.total));


        TextView pic = helper.getView(R.id.token_pice_tv);
        TextView totalView = helper.getView(R.id.token_total_tv);
        TextView address = helper.getView(R.id.toke_address);
        TypefaceUtils.setCenturyGotHic(pic, mContext);
        TypefaceUtils.setCenturyGotHic(totalView, mContext);
        TypefaceUtils.setCenturyGothicBold(address, mContext);


    }
}
